package com.keba.lamp.complaint.controller;

import com.keba.basic.annotation.log.WebLog;
import com.keba.basic.base.R;
import com.keba.basic.base.controller.SuperController;
import com.keba.basic.interfaces.echo.EchoService;
import com.keba.lamp.complaint.entity.Agent;
import com.keba.lamp.complaint.service.AgentService;
import com.keba.lamp.complaint.vo.query.AgentPageQuery;
import com.keba.lamp.complaint.vo.result.AgentResultVO;
import com.keba.lamp.complaint.vo.save.AgentSaveVO;
import com.keba.lamp.complaint.vo.update.AgentSummarizeUpdateVO;
import com.keba.lamp.complaint.vo.update.AgentUpdateVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * 代理人信息
 * </p>
 *
 * @author chaowu.wang
 * @date 2025-09-13 18:19:51
 * @create [2025-09-13 18:19:51] [chaowu.wang] [代码生成器生成]
 */
@Slf4j
@RequiredArgsConstructor
@Validated
@RestController
@RequestMapping("/agent")
@Tag(name = "代理人信息")
public class AgentController extends SuperController<AgentService, Long, Agent
    , AgentSaveVO, AgentUpdateVO, AgentPageQuery, AgentResultVO> {
    private final EchoService echoService;
    @Override
    public EchoService getEchoService() {
        return echoService;
    }


    @Operation(summary = "修改代理人信息")
    @PostMapping("/updateSummarizeInfo")
    @WebLog(value = "修改代理人信息", request = false)
    public R updateSummarizeInfo(@RequestBody @Validated AgentSummarizeUpdateVO agentSummarizeUpdateVO) {
        boolean result = this.superService.updateSummarizeInfo(agentSummarizeUpdateVO);
        return result ? R.success() : R.fail("修改失败");
    }
}


